package com.yjhb.android.sbz.mvp.vip;

import com.yjhb.android.sbz.http.HttpObserver;
import com.yjhb.android.sbz.http.HttpTool;
import com.yjhb.android.sbz.mvp.ConventionPresenter;

/**
 * 创建者 zx
 * 创建时间 2020/12/8 10:35
 */
public class VipPresenter extends ConventionPresenter<VipView> {
    private final String TAG = "VipPresenter";

    @Override
    protected void onDestroy() {

    }

    public VipPresenter(VipView vipView) {
        super(vipView);
    }


    public void balanceToVip(Integer vipLevel) {
        if (view != null) {
            view.onWait();
        }
        HttpTool.request(model.balanceToVip(2, vipLevel), new HttpObserver<Object>() {
            @Override
            public void onResult(Object data) {
                if (view != null) {
                    view.onSuccess(data);
                }
            }

            @Override
            public void onError(int code, String msg) {
                if (view != null) {
                    view.onFailure(code, msg);
                }
            }
        });
    }
}
